/*
 * @author zzr
 * @date: 2025/05/10  15:48
 * @description: 工厂方法~
 */
class Point {
    private double x;
    private double y;
    private double r;
    private double a;

    public void setX(double x) {
        this.x = x;
    }

    public void setY(double y) {
        this.y = y;
    }

    public void setR(double r) {
        this.r = r;
    }

    public void setA(double a) {
        this.a = a;
    }
    public static Point getPointByXY (double x, double y) {
        Point p = new Point();
        p.setX(x);
        p.setY(y);
        return p;
    }
    public static Point getPointByRA (double r, double a) {
        Point p = new Point();
        p.setR(r);
        p.setA(a);
        return p;
    }
}

public class Demo10 {
    public static void main(String[] args) {

        Point point = Point.getPointByRA(5,10);
        Point point1 = Point.getPointByXY(10,5);

    }
}
